package com.gjy.util.encryption.base64;

import org.bouncycastle.util.encoders.Base64;
import org.bouncycastle.util.encoders.UrlBase64;

/**
 * Base64 算法
 *
 * @author 宫静雨
 * @version 1.0
 * @since 2022-11-05 13:15:02
 */
public class Base64Coder {

    public static byte[] encode(byte[] data) {
        return Base64.encode(data);
    }

    public static byte[] decode(byte[] data) {
        return Base64.decode(data);
    }

    public static String string(byte[] data) {
        return Base64.toBase64String(data);
    }

    public static byte[] urlEncode(byte[] data) {
        return UrlBase64.encode(data);
    }

    public static byte[] urlDecode(byte[] data) {
        return UrlBase64.decode(data);
    }
}
